import type { CountryQhInfo } from '@/types/baseTypes'
import Request from './axios-request'

class zjAxios {
  public axios: Request

  constructor() {
    this.axios = new Request({ url: import.meta.env.VITE_API_ZJ_URL_API })
  }

  public post(url: string, data?: object) {
    return this.axios.post(url, data)
  }

  public get(url: string, data?: object) {
    return this.axios.get(url, data)
  }

  public GetCountryQhInfo(): Promise<CountryQhInfo> {
    return this.axios.get(`XzspjCountLegalPersonData`, { year: 2024 })
  }

  public GetNearlyHalf(): Promise<CountryQhInfo> {
    return this.axios.post(`XzspjNearlySixMonths`, { areacode: 'all', centerguid: 'all' })
  }
}
export default new zjAxios()
